#ifndef HEADER_FENSCORES
#define HEADER_FENSCORES

#include <vector>
#include <SDL/SDL.h>
#include <iostream>

#include "../glob.h"
#include "../Composant/Liste.h"
#include "../ListeChainee.h"
#include "../Pion.h"
#include "../PlateForme/Stable.h"
#include "../PlateForme/PlateForme.h"
#include "../Composant/SDL_Table.h"
#include "Fenetre.h"

using namespace std;

class FenScores : public Fenetre
{
public :
    //prend une liste chainne de score_struct_moyenne
    FenScores(SDL_Surface *ecran , ListeChainee* vec);
    int afficher();
    void setScores(ListeChainee* vect);
    void ajouterScore(Score_struct_Moyenne sc);
    void changerMode(int mode );

    bool operator()(const Score_struct_Moyenne& s1 , const Score_struct_Moyenne&s2);

private :
    enum mode{MOYENNE , MAX  ,MIN , NBPARTI};
    SDL_Table *table;
    vector<Score_struct_Moyenne> vecMoyen;
    vector<PlateForme*> podium;
    Pion *p1;
    Pion *p2;
    Pion *p3;

};


struct TriParMax{
    bool operator()(const Score_struct_Moyenne& s1 , const Score_struct_Moyenne& s2) const
    {
        return s2.valMax < s1.valMax;
    }
};

struct TriParMoyenne{
    bool operator()(const Score_struct_Moyenne& s1 , const Score_struct_Moyenne& s2) const
    {
        return s2.valMoy < s1.valMoy;
    }
};

struct TriParMini{
    bool operator()(const Score_struct_Moyenne& s1 , const Score_struct_Moyenne& s2) const
    {
        return s2.valMin > s1.valMin;
    }
};

struct TriTable{
     bool operator()(const Score_struct_Moyenne& s1 , const Score_struct_Moyenne& s2) const
    {
        return  s2.valMoy < s1.valMoy ;
    }
};

struct TriNbPartie{
     bool operator()(const Score_struct_Moyenne& s1 , const Score_struct_Moyenne& s2) const
    {
        return  s2.nbPartie < s1.nbPartie ;
    }
};

#endif
